#include <bits/stdc++.h>
using namespace std;
#define int long long

int sqr(int x) {
	int l = 0, r = 1e9 + 7;
	while (l + 1 != r) {
		int mid = (l + r) / 2;
		if (mid * mid >= x) r = mid;
		else l =mid;
	}
	return r;
}

int sqrdow(int x) {
	int l = 0, r = 1e9 + 7;
	while (l + 1 != r) {
		int mid = (l + r) / 2;
		if (mid * mid > x) r = mid;
		else l =mid;
	}
	return r - 1;
}

signed main() {
	freopen("tree.in", "r", stdin); freopen("tree.out", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(0);
	int tc, x; cin >> tc; while (tc--) {
		cin >> x; cout << (sqr(x) * 2) + (x % 2 || (4 * x >= (1 + 2 * sqrdow(x)) * (1 + 2 * sqrdow(x))) || (sqr(x) * sqr(x) == x)) << "\n";
	}
	return 0;
}
